<%@ page language="java" contentType="text/html; charset=UTF-8"   import="java.util.*,SiTuQingYou.vo.*,SiTuQingYou.util.*"
    pageEncoding="UTF-8"%>
    <%String path = request.getContextPath();%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
   td{
   width:80px;
   height:50px;
   }
   #cont{
   width:400px;
   }
   img{
   width:90px;
   height:90px;
   }
</style>
</head>
<body>
<jsp:include page="/StrategyServlet">
<jsp:param value="showallaub" name="method"/>
</jsp:include>
  <table>
  <tr><td>攻略名称</td>
    <td id="cont">攻略内容</td>
    <td>攻略图片</td>
    <td>攻略作者</td>
    <td>审核状态</td>
  </tr>
     <%  
     ArrayList<Strategy> str = (ArrayList<Strategy>)request.getAttribute("str");
    
     for(Strategy stra:str){  
    	%>
     
    	 <tr><td><%=stra.getTitle() %></td>
    	 	 <td><%=stra.getContent()%></td>
    	 	 <td><img src="<%=path%>/imagess/<%=stra.getPhoto() %>"></td>
    	 	 <td><%=stra.getUser().getUsername() %></td>
    	 	 <td><input  cid="<%=stra.getId() %>"  type="button" c="1" id="pass" value="通过">
    	 	     <input  cid="<%=stra.getId() %>"  type="button" c="2" id="nopass" value="不通过"></td>
    	 	 
    	 	   <td><select id="yuanyin"><option  value="内容灌水" >内容灌水</option>
    	 	   				<option value="广告植入">广告植入</option>
    	 	   				<option value="诱导关注">诱导关注</option>
    	 	   				<option value="涉嫌暴力">涉嫌暴力</option></select></td>
    	 	   	 	     </tr>
    	     
    <%  }
     %>
</table>
  <script type="text/javascript" src="<%=path %>/houtai/js/jquery-3.3.1.min.js"></script>
  <script type="text/javascript">
     $(document).ready(function(){
    	 $("input[id=pass]").click(function(){
    		 var cid = $(this).attr("cid");
    		 var c = $(this).attr("c");
    		   var thiss= $(this);
    		 $.ajax({
     			url:"<%=path %>/StrategyServlet",
     			type:"post",
     			data:"method=passornopass&cid="+cid+"&c="+c,
     			success:function(mes){
     				thiss.parent().parent().remove();
   			}
     		});
    	 });
     });
  </script>
  <script type="text/javascript">
  $(document).ready(function(){
	  $("input[id=nopass]").click(function(){
		  var cid = $(this).attr("cid");
 		 var c = $(this).attr("c");
 		   var thiss= $(this);
 		  var name = $("#yuanyin").val();
 		  $.ajax({
   			url:"<%=path %>/StrategyServlet",
   			type:"post",
   			data:"method=passornopass&cid="+cid+"&c="+c+"&yuanyin="+name,
   			success:function(mes){
   				thiss.parent().parent().remove();
 			}
   		});
	  });
  });
  
  </script>
  

</body>
</html>